#include "person.h"
#include<vector>
#include<queue>
using namespace std;

struct pp{
    int id;
    person p;
}info[4];

vector<person> v;
queue<person> q;

int n;
int age, id;
string name;

int main(int argc, char **argv){
    cout << "Input 3 people's information" << endl;
    for(int i = 1; i <= 3; ++i){
        cout << "input the id of person" << i << ":" << endl;
        cin >> info[i].id;
        cout << "input the age of person" << i << ":" << endl;
        cin >> age;
        cout << "input the name of person" << i << ":" << endl;
        cin >> name;
        info[i].p.setInfo(age, name);
        person t(age, name);
        v.push_back(t);
        q.push(t);
    }
    cout << "start to print their infomation by struct" << endl;\
    n = 3;
    while(n){
        cout << "the information of person " << info[n].id << ":";
        info[n].p.showInfo();
        n--;
    }
    cout << "now they are in a queue" << endl;
    while(!q.empty()){
        person tmp = q.front();
        tmp.showInfo();
        q.pop();
    }
    cout << "now they are in a vector" << endl;
    for(int i = 0; i < v.size(); ++i){
        v[i].showInfo();
    }
    v.clear();
    return 0;
}